<?php

namespace App\Providers;

use App\Models\UserLog;
use Encore\Admin\Config\Config;
use App\Observers\UserLogObserver;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        $table = config('admin.extensions.config.table', 'admin_config');
        if (Schema::hasTable($table)) {
            Config::load();
        }

        Schema::defaultStringLength(191);
        UserLog::observe(UserLogObserver::class);
    }
}
